// 构造方法命名、守护线程isDaemon,判断线程的PCB是否存在isAlive
public class ThreadTest {
    public static void main(String[] args) {
        Thread t = new Thread("MyThread"){
            @Override
            public void run(){
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println("构造方法给线程取名！");
            }
        };
        t.start();
        System.out.println(t.isDaemon());

        while (true) {
            System.out.println(t.isAlive());
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
